package com.powergisol.gis.controller;
import	java.awt.Desktop.Action;


import com.powergisol.gis.model.Result;
import com.powergisol.gis.service.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

@RestController
@RequestMapping("tabUser")
public class UserController {
    @Autowired
    private UserServiceImpl userService;

    @PostMapping("upPassword")
    public Result upPassword(String oldPassword, String newPassword, Principal p){
        return userService.upPassword(oldPassword,newPassword, p.getName());
    }
}
